home *** CD-ROM | disk | FTP | other *** search
- property ancestor, pSectCurrent, pSpriteNum, pFirstMemberNum, pMyButtonNumber, pCommand
- global gScript
-
- on birth me, mySprite, myFirstCastNum, catButton1to4Number, myPCommand
- set pSectCurrent to 0
- set pSpriteNum to mySprite
- set pFirstMemberNum to myFirstCastNum
- set pMyButtonNumber to catButton1to4Number
- set pCommand to myPCommand
- set ancestor to new(script "ButtonAncestor", me)
- set the memberNum of sprite pSpriteNum to pFirstMemberNum
- add(the actorList, me)
- return me
- end
-
- on mClickOnButton me, mySoundFile, myForceClickFlag
- if pSectCurrent then
- exit
- end if
- repeat while the stillDown
- repeat while rollOver(pSpriteNum) and the stillDown
- castNumberSet(pSpriteNum, pFirstMemberNum + 2)
- updateStage()
- end repeat
- if not rollOver(pSpriteNum) then
- castNumberSet(pSpriteNum, pFirstMemberNum)
- updateStage()
- end if
- end repeat
- if rollOver(pSpriteNum) or (myForceClickFlag = 1) then
- castNumberSet(pSpriteNum, pFirstMemberNum + 2)
- resetOtherButtons(me, pSpriteNum)
- set pSectCurrent to 1
- do(pCommand)
- else
- castNumberSet(pSpriteNum, pFirstMemberNum)
- updateStage()
- end if
- end
-
- on resetOtherButtons me, myCurrSprite
- repeat with i = 1 to count(the pSectButtonSpriteList of gScript)
- set otherSprite to getAt(the pSectButtonSpriteList of gScript, i)
- if myCurrSprite = otherSprite then
- nothing()
- else
- set the castNum of sprite otherSprite to the pSectButtonFirstMemNum of gScript + ((i * 3) - 3)
- set the pSectCurrent of getAt(the pButtonObjectList of gScript, i) to 0
- end if
- updateStage()
- end repeat
- end
-
- on castNumberSet mySprite, myMemberNum
- set the memberNum of sprite mySprite to myMemberNum
- end
-